/* Layout */
import Layout from '@/layout'
// 固定路由
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  }
  /* {
    path: '/_f/!*',
    component: () => import('@/layout/iframe'),
    hidden: true
  }*/
  // 404 page must be placed at the end !!!
  // { path: '*', redirect: '/404', hidden: true }
]

/**
 * 可变路由
 * 这里有个严格的约定：
 *      所有子路由中的path 必须写完整路径，禁止用上下级相对路径的写法
 * @type {*[]}
 */
export const volatileRoutes = [

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: '/dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: { title: '首页', icon: 'dashboard', affix: 'true' }
    }]
  },
  {
    path: '/example',
    component: Layout,
    redirect: '/example/table',
    name: 'Example',
    meta: { title: 'example', icon: 'example' },
    children: [
      {
        path: '/example/table',
        name: 'Table',
        component: () => import('@/views/table/index'),
        meta: { title: '表格', icon: 'table' }
      },
      {
        path: '/example/tree',
        name: 'Tree',
        component: () => import('@/views/tree/index'),
        meta: { title: '树', icon: 'tree' }
      }
    ]
  },
  {
    path: '/sys',
    component: Layout,
    redirect: '/sys/menu',
    meta: { title: '系统设置', icon: 'example' },
    children: [
      {
        path: '/sys/menu',
        name: 'SysMenu',
        component: () => import('@/views/sys/menu/index'),
        meta: { title: '菜单设置', icon: 'tree' }
      },
      {
        path: '/sys/dep',
        name: 'SysDep',
        component: () => import('@/views/sys/dep/index'),
        meta: { title: '组织管理', icon: 'tree' }
      },
      {
        path: '/sys/role',
        name: 'SysRole',
        component: () => import('@/views/sys/Role/index'),
        meta: { title: '组织管理', icon: 'tree' }
      },
      {
        path: '/sys/dict',
        name: 'SysDict',
        component: () => import('@/views/sys/Dict/index'),
        meta: { title: '字典管理', icon: 'tree' }
      },
      {
        path: '/sys/dictgroup',
        name: 'SysDictGroup',
        component: () => import('@/views/sys/Dict/DictGroup/index'),
        meta: { title: '字典分组', icon: 'tree' }
      },
      {
        path: '/sys/user',
        name: 'SysUser',
        component: () => import('@/views/sys/User/index'),
        meta: { title: '系统用户', icon: 'tree' }
      },
      {
        path: '/sys/depUser',
        name: 'SysDepUser',
        component: () => import('@/views/sys/DepUser/index'),
        meta: { title: '用户组织关系对象，组织成员', icon: 'tree' }
      },
      {
        path: '/sys/station',
        name: 'SysStation',
        component: () => import('@/views/sys/Station/index'),
        meta: { title: '岗位管理', icon: 'tree' }
      }
    ]
  },

  {
    path: '/form',
    component: Layout,
    meta: { title: '表单', icon: 'example' },
    redirect: '/form/index',
    children: [
      {
        path: '/form/index',
        name: 'Form',
        component: () => import('@/views/form/index'),
        meta: { title: 'Form', icon: 'form' }
      },
      {
        path: '/example/table',
        name: 'Table',
        component: () => import('@/views/table/index'),
        meta: { title: '表格', icon: 'table' }
      }
    ]
  },

  {
    path: '/nested',
    component: Layout,
    redirect: '/nested/menu1',
    name: 'Nested',
    meta: {
      title: 'Nested',
      icon: 'nested'
    },
    children: [
      {
        path: '/nested/menu1',
        component: () => import('@/views/nested/menu1/index'), // Parent router-view
        name: 'Menu1',
        meta: { title: 'Menu1' },
        children: [
          {
            path: '/nested/menu1/menu1-1',
            component: () => import('@/views/nested/menu1/menu1-1'),
            name: 'Menu1-1',
            meta: { title: 'Menu1-1', icon: 'chart' }
          },
          {
            path: '/nested/menu1/menu1-2',
            component: () => import('@/views/nested/menu1/menu1-2'),
            name: 'Menu1-2',
            meta: { title: 'Menu1-2' },
            children: [
              {
                path: '/nested/menu1/menu1-2/menu1-2-1',
                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
                name: 'Menu1-2-1',
                meta: { title: 'Menu1-2-1', icon: 'excel' }
              },
              {
                path: '/nested/menu1/menu1-2/menu1-2-2',
                component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
                name: 'Menu1-2-2',
                meta: { title: 'Menu1-2-2' }
              }
            ]
          },
          {
            path: '/nested/menu1/menu1-3',
            component: () => import('@/views/nested/menu1/menu1-3'),
            name: 'Menu1-3',
            meta: { title: 'Menu1-3' }
          }
        ]
      },
      {
        path: '/nested/menu2',
        component: () => import('@/views/nested/menu2/index'),
        meta: { title: 'menu2' }
      }
    ]
  },

  {
    path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
    component: Layout,
    meta: { title: 'External Link', icon: 'link' }
    /* children: [
      {
        path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
        meta: { title: 'External Link', icon: 'link' }
      }
    ]*/
  }
]
